package com.kjj.gift.clients;

import com.kjj.gift.dto.RegisterPhoneValidateDto;
import com.kjj.gift.dto.SMSCodeDto;
import com.kjj.gift.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@FeignClient(value = "gift-common",fallbackFactory = SmsValidateCodeClientFallbackFactory.class)
public interface SmsValidateCodeClient {    // 注册验证码

    @PostMapping("/sms/sendCode")
    AjaxResult sendSmsCode(@RequestBody @Valid SMSCodeDto smsCodeDto);

    @PostMapping("/sms/validate")
    AjaxResult validateRegisterCode(@RequestBody RegisterPhoneValidateDto dto);
}
